Skip to content

Only pull unique values in generate_vocab #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

boomanaiden154
Copy link
Collaborator

This patch makes generate_vocab only consider unique values when creating quantile buckets for the individual features. There is no point in mapping multiple of the same value to different values post normalization/bucketization. This only serves to decrease dynamic range. Only looking at unique values preserves the property of increasing dynamic range around areas that have lots of slightly different values. This is especially useful when generating vocab for features that are oftentimes zero or one. In some cases I was seeing <50/1000 actual values with the rest being zeros or ones, which results in models that train poorly.

This patch makes generate_vocab only consider unique values when
creating quantile buckets for the individual features. There is no point
in mapping multiple of the same value to different values post
normalization/bucketization. This only serves to decrease dynamic range.
Only looking at unique values preserves the property of increasing
dynamic range around areas that have lots of slightly different values.
This is especially useful when generating vocab for features that are
oftentimes zero or one. In some cases I was seeing <50/1000 actual
values with the rest being zeros or ones, which results in models that
train poorly.
@boomanaiden154
Copy link
Collaborator Author

Running some BC hparam explorations right now with one of the parameters I'm exploring being vocab. I'm ablating against the current vocab in tree, new vocab without this patch, and new vocab with this patch. I'll try and post the results here once I have them in a couple hours.

@mtrofin mtrofin requested review from alekh and tvmarino May 1, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant